package com.itlong.cloud.property.resource;

import com.itlong.cloud.POJO.DTO.property.PropertyValueServerSaveDTO;
import com.itlong.cloud.POJO.VO.property.PropertyValueServerGetOneVO;
import com.itlong.cloud.project.property.IPropertyValueServerServiceClient;
import com.itlong.cloud.property.service.IPropertyValueServerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
import java.util.Set;

/**
 * <desc>
 *    临时通行增值业务服务暴露接口实现类.
 * </desc>
 *
 * @createDate 2018-08-13
 */
@RestController
public class PropertyValueServerServiceResource implements IPropertyValueServerServiceClient {

    @Autowired
    IPropertyValueServerService iPropertyValueServerService;

    /**
     * <desc>
     *     处理过期临时通行房间
     * <desc/>
     *
     * @return  MessageVO 标准格式化响应结果
     * @author Qiang.S
     * @createDate 2019/05/31
     */
    @Override
    @RequestMapping(path = "/expenses/value/doTemporaryOverdue",method = {RequestMethod.POST})
    public Map<String, Set<String>> doTemporaryOverdue() throws Exception{
        return iPropertyValueServerService.doTemporaryOverdue();
    }

    /**
     * <desc>
     *      获取单个对象
     * </desc>
     *
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/05/29
     */
    @PostMapping(path = "/property/propertyValue/payRule/getOne")
    @Override
    public PropertyValueServerGetOneVO getOne(@RequestParam("projectId") String projectId) {
        return iPropertyValueServerService.getOne(projectId);
    }

    /**
     * <desc>
     *      保存物业增值配置
     * </desc>
     *
     * @param dto
     * @return
     * @author Jiaqi.X
     * @createDate 2019/05/29
     */
    @PostMapping(path = "/property/propertyValue/payRule/save")
    @Override
    public String save(@RequestBody PropertyValueServerSaveDTO dto) throws Exception {
        return iPropertyValueServerService.save(dto);
    }
}
